<?php
//20110707
require_once 'Shared/Models/Scontent.php';
require_once 'Shared/Models/ScontentLang.php';
require_once 'Shared/Models/ScontentCategory.php';
//20110707
class top_menuSticker extends Vi_Sticker
{
	public function run()
	{
//	    $langCode = Vi_Registry::get('langCode');
//	    
//	    $loggedUser = Vi_Registry::getLoggedInUser();
//	    $isLoggedIn = true;
//	    if (false == $loggedUser) {
//	        $isLoggedIn = false;
//	    }
//	    
//	    $this->view->loggedUser = $loggedUser;
//	    $this->view->isLoggedIn = $isLoggedIn;
//	    
//	    $this->view->fqaUrl = Vi_Registry::getContentUrl(15);
		$menus = array(
            0 => array(
                     'url' => Vi_Registry::getContentUrl(21),
                    'name' => 'SERVICES',
                    'id' => 1
                    ),
            1 => array(
                    'url' => Vi_Registry::getContentUrl(23),
                    'name' => 'ABOUT US',
                    'id' => 1
                    ),
            2 => array(
                    'url' => Vi_Registry::getContentUrl(22),
                    'name' => 'SIGN IN',
                    'id' => 2
                    ),
            3 => array(
                    'url' => Vi_Registry::getAppBaseUrl() . 'contact-us.html',
                    'name' => 'CONTACT US',
                    'id' => 'contactus'   
                    ),     
                    
        );
        $this->view->menus = $menus;
        //20110707
        $portalAlias = Vi_Registry::getAppName();
        $objPortal = new Models_Portal();
        $portal = $objPortal->getPortalbyAlias($portalAlias);
        $portal = current($portal);
        $this->view->portalId = $portal['portal_id'];
        $objScontent = new Models_Scontent();
        $scontent = $objScontent->getAllContentsWithLang();
        foreach($scontent as &$item)
        	$item['url'] = Vi_Registry::getAppBaseUrl(). 'page/' . $item['url'] . '.html';
        $this->view->scontent = $scontent;
        unset($item);
		$this->view->contactUrl = $menus[3][url];
		$this->view->contactName = $menus[3][name];
		$this->view->menuId = 1;//top menu
        //20110707
	}
}